package edu.sctu.java.advanced.event;

import java.util.ArrayList;
import java.util.List;

public class EventManager {
    public static final String USER_ADD = "user_add";

    List<EventListener> eventListenerList;

    public EventManager() {
        this.eventListenerList = new ArrayList<>();
    }

    void addListener(EventListener listener) {
        this.eventListenerList.add(listener);
    }

    void fireEvent(Event e) {
        for (EventListener listener : this.eventListenerList) {
            listener.fireEvent(e);
        }
    }
}
